package bootstrap

import (
	"card/pkg/server/ws"
	"github.com/gin-gonic/gin"
	"net/http"
)

func SetUpWs(router *gin.Engine) {
	router.GET("/ws", func(c *gin.Context) {
		manager := ws.NewManager(func(r *http.Request) bool {
			return r.Header["Origin"][0] != "http://example.com"
		}, registerHandler())
		manager.ServeWS(c)
	})
}

func registerHandler() ws.LogicHandler {
	handlers := make(ws.LogicHandler)
	return handlers
}
